<template>
  <div class="child">
    <h1>我是Child组件</h1>
    <div>{{sum}}</div>
  </div>
</template>

<script>
import {ref} from "vue";

export default {
  name: "Child",
  async setup(){
    let sum=ref(0)
    const p=  new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({sum})
      },3000)
    })
    return await p
  }
}
</script>

<style scoped>
.child{
  background-color: orange;
  padding: 10px;
}
</style>
